package com.lening.service.impl;

import com.lening.entity.Player;
import com.lening.entity.School;
import com.lening.entity.Team;
import com.lening.mapper.PlayerMapper;
import com.lening.service.PlayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 作者：曹明达
 * 创建时间：2020/9/1,9:14
 */
@Service
public class PlayerServiceImpl implements PlayerService {

    @Autowired
    private PlayerMapper playerMapper;
    @Override
    public List<Player> findAll() {
        return playerMapper.findAll();
    }

    @Override
    public List<School> findSchool() {
        return playerMapper.findSchool();
    }

    @Override
    public List<Team> getTeam() {
        return playerMapper.getTeam();
    }

    @Override
    public void savePlayer(Player player) {
        playerMapper.savePlayer(player);
    }

    @Override
    public void deletePlayer(long[] ids) {
        if(ids!=null&&ids.length>=1){
            playerMapper.deletePlayer(ids);
        }
    }
}
